﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Applica.Models;

namespace Applica
{
    public class DataRepository
    {
        private homewizard_test2databaseEntities db;

        public DataRepository()
        {
            db = new homewizard_test2databaseEntities();
        }
        public SponsorInputs345xModel GetMobileVersionData(String sponsor)
        {
            var model = new SponsorInputs345xModel();
            model = (from s in db.SponsorInputs345x
                     where s.sponsor == sponsor
                     select new SponsorInputs345xModel()
                     {
                         Sponsor_ID = s.Sponsor_ID,
                         sponsor = s.sponsor,
                         icompany_name = s.icompany_name,
                         iphone_number = s.iphone_number,
                         iname_line = s.iname_line,
                         imessage_welcome = s.imessage_welcome,
                         imessage_myscreen = s.imessage_myscreen,
                         iemail_address = s.iemail_address,
                         iwebsite = s.iwebsite,
                         ipscountry = s.ips_country,
                         ipsstateprovince = s.ips_state_province,
                         ipromocode = s.ipromocode,
                         ilogo_pic = s.ilogo_pic,
                         ispec_features_msg = s.ispec_features_msg,
                         itagline = s.itagline,
                         icompany_admin_link = s.icompany_admin_link,
                         icon_phone_number = s.icon_phone_number
                         ,
                         icon_email_address = s.icon_email_address,
                         icon_web_address = s.icon_web_address,
                         ifacebook = s.ifacebook,
                         itwitter = s.itwitter
                     }).FirstOrDefault();
            return model;
        }
        
    }
}